package com.hp.tiger.chapter6;

/**
 * @author XavierDong
 **/

/**
 * ReadWriteLock design pattern
 * Reader-Writer design pattern
 */
public class ReadWriteLockClient {


    public static void main(String[] args) {
        final SharedData sharedData = new SharedData(10);
        new ReadWorker(sharedData).start();
        new ReadWorker(sharedData).start();
        new ReadWorker(sharedData).start();
        new ReadWorker(sharedData).start();
        new ReadWorker(sharedData).start();
        new WriteWorker(sharedData, "qwertyuiopasdf").start();
        new WriteWorker(sharedData, "QWERTYUIOPASDF").start();
    }
}
